Skip to content

[AccessoryAccess] Add bindings up to Xcode 27.0 Beta 3#25982

Merged
dalexsoto merged 7 commits into
xcode27.0from
dev/alex/xc27-accessoryaccess
Jul 12, 2026
Merged

[AccessoryAccess] Add bindings up to Xcode 27.0 Beta 3#25982
dalexsoto merged 7 commits into
xcode27.0from
dev/alex/xc27-accessoryaccess

Conversation

@dalexsoto

Copy link
Copy Markdown
Member

Bind the AccessoryAccess framework (macOS 27.0), resolving all entries in tests/xtro-sharpie/api-annotations-dotnet/macOS-AccessoryAccess.todo:

  • AAUSBAccessory (NSSecureCoding)
  • AAUSBAccessoryManager (with the shared manager + listener registration)
  • AAUSBAccessoryMatchingCriteria (NSCopying)
  • AAUSBAccessoryListener protocol
  • AAErrorCode / AAErrorDomain
  • AAUSBAccessoryMatchingCriteriaInterfaceMatchingOption

Register the framework for macOS, update the LinkMode=None linked-frameworks test, regenerate the documentation known-failures baseline, and remove the resolved .todo file.

Bind the AccessoryAccess framework (macOS 27.0), resolving all entries in
tests/xtro-sharpie/api-annotations-dotnet/macOS-AccessoryAccess.todo:

* AAUSBAccessory (NSSecureCoding)
* AAUSBAccessoryManager (with the shared manager + listener registration)
* AAUSBAccessoryMatchingCriteria (NSCopying)
* AAUSBAccessoryListener protocol
* AAErrorCode / AAErrorDomain
* AAUSBAccessoryMatchingCriteriaInterfaceMatchingOption

Register the framework for macOS, update the LinkMode=None linked-frameworks
test, regenerate the documentation known-failures baseline, and remove the
resolved .todo file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dalexsoto dalexsoto added this to the xcode27 milestone Jul 8, 2026
@dalexsoto dalexsoto requested a review from rolfbjarne as a code owner July 8, 2026 20:38
Copilot AI review requested due to automatic review settings July 8, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new macOS binding surface for Apple’s AccessoryAccess framework (macOS 27.0), integrates it into the build’s framework registration/defines, and updates test baselines to reflect the new public API.

Changes:

  • Added new binding definitions for AccessoryAccess (types, enums, protocol, and async-friendly APIs).
  • Registered AccessoryAccess as a macOS framework and enabled HAS_ACCESSORYACCESS for .NET macOS builds.
  • Updated linked-framework expectations and regenerated documentation known-failures; removed the resolved xtro todo.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/common/Frameworks.cs Registers AccessoryAccess as a macOS framework (27.0).
tests/xtro-sharpie/api-annotations-dotnet/macOS-AccessoryAccess.todo Removes resolved xtro annotations for AccessoryAccess.
tests/dotnet/UnitTests/ProjectTest.cs Updates macOS LinkMode=None linked-framework expectations to include AccessoryAccess.
tests/cecil-tests/Documentation.KnownFailures.txt Regenerates doc-known-failure baseline for newly introduced AccessoryAccess symbols.
src/rsp/dotnet/macos-defines-dotnet.rsp Adds -d:HAS_ACCESSORYACCESS define for .NET macOS builds.
src/frameworks.sources Adds AccessoryAccess to the macOS frameworks list used by the build.
src/build/dotnet/generator-frameworks.g.cs Updates generated framework-availability helpers to include AccessoryAccess.
src/accessoryaccess.cs Introduces the AccessoryAccess binding definitions (macOS 27.0).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #b8c602d] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: b8c602d10246822f9ff14d8794773da01fb85423 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto

Copy link
Copy Markdown
Member Author

Note to self we must run size tests when adding a new framework, or maybe just run them all the time...

DotNet tests: Failed (Execution failed with exit code 1)
Xamarin.Tests.AppSizeTest.CoreCLR_Interpreter_TrimmableStatic(Ma...: App size changed significantly (+69,040 bytes (67.4 KB = 0.1 MB) different > tolerance of +-10,240 bytes (10.0 KB = 0.0 MB)). Ex...
Xamarin.Tests.AppSizeTest.CoreCLR_Interpreter(MacOSX,"osx-arm64;...: App size changed significantly (+43,440 bytes (42.4 KB = 0.0 MB) different > tolerance of +-10,240 bytes (10.0 KB = 0.0 MB)). Ex...
Xamarin.Tests.AppSizeTest.NativeAOT_TrimmableStatic(MacOSX,"osx-...: App size changed significantly (+16,400 bytes (16.0 KB = 0.0 MB) different > tolerance of +-10,240 bytes (10.0 KB = 0.0 MB)). Ex...

@vs-mobiletools-engineering-service2

This comment has been minimized.

Comment thread src/accessoryaccess.cs Outdated
Comment thread src/accessoryaccess.cs Outdated
* Rename the AAUSB* types to AAUsb* (Usb casing) per review, preserving the
  native Objective-C names via [BaseType (Name=)], [Protocol (Name=)] and
  [Native (...)].
* Bind the IOUSBHostDevice handle delivered by AAUsbAccessory.Open as IntPtr
  instead of NSObject (IOUSBHost is intentionally not bound in macios; the
  raw handle is valid until Close).
* Regenerate the documentation known-failures baseline for the renamed symbols.
* Update the macOS expected app size files to account for the new
  AccessoryAccess types in Microsoft.macOS.dll.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dalexsoto dalexsoto requested a review from rolfbjarne July 9, 2026 19:12
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Comment thread src/accessoryaccess.cs Outdated
Comment on lines +30 to +35
// 'device' is a live IOUSBHostDevice handle (an IOUSBHost Objective-C object). IOUSBHost is
// intentionally not bound in macios (a low-level IOKit/DriverKit-adjacent, NS_REFINED_FOR_SWIFT
// framework; see IGNORED_MACOS_FRAMEWORKS in tests/xtro-sharpie/Makefile), so the handle is surfaced
// as a raw IntPtr that stays valid until the accessory is closed (Close). To perform USB I/O, hand
// the accessory to a native/Swift service via CreateXpcRepresentation, or bridge the handle through
// native IOUSBHost code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least part of this information sounds like it could be useful in an xml comment on the delegate.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot understand the context and please apply this suggestion

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 8e8538b. I added XML documentation to AAUsbAccessoryOpenCompletionHandler, including the device handle semantics and native IOUSBHost guidance.

Copilot AI and others added 2 commits July 10, 2026 22:55
Co-authored-by: dalexsoto <204671+dalexsoto@users.noreply.github.com>
Co-authored-by: dalexsoto <204671+dalexsoto@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [CI Build #c01806c] Prepare .NET Release succeeded ✅

📦 Published NuGet packages (32 packages)

iOS

  • Microsoft.iOS.Ref.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.iOS.Runtime.ios-arm64.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.iOS.Runtime.ios.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.iOS.Runtime.iossimulator-arm64.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.iOS.Runtime.iossimulator-x64.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.iOS.Sdk.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.iOS.Templates.27.0.10221-xcode27.0.nupkg
  • Microsoft.iOS.Windows.Sdk.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.NET.Sdk.iOS.Manifest-10.0.400-preview.0.27.0.10221-xcode27.0.nupkg

MacCatalyst

  • Microsoft.MacCatalyst.Ref.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Sdk.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Templates.27.0.10221-xcode27.0.nupkg
  • Microsoft.NET.Sdk.MacCatalyst.Manifest-10.0.400-preview.0.27.0.10221-xcode27.0.nupkg

macOS

  • Microsoft.macOS.Ref.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.macOS.Runtime.osx-arm64.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.macOS.Runtime.osx-x64.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.macOS.Runtime.osx.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.macOS.Sdk.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.macOS.Templates.27.0.10221-xcode27.0.nupkg
  • Microsoft.NET.Sdk.macOS.Manifest-10.0.400-preview.0.27.0.10221-xcode27.0.nupkg

tvOS

  • Microsoft.NET.Sdk.tvOS.Manifest-10.0.400-preview.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.tvOS.Ref.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.tvOS.Runtime.tvos-arm64.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.tvOS.Runtime.tvos.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.tvOS.Runtime.tvossimulator-arm64.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.tvOS.Runtime.tvossimulator-x64.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.tvOS.Sdk.net10.0_27.0.27.0.10221-xcode27.0.nupkg
  • Microsoft.tvOS.Templates.27.0.10221-xcode27.0.nupkg

Other

  • Sharpie.Bind.Tool.27.0.0.221-xcode27.0.nupkg

Pipeline on Agent
Hash: c01806cb395372f0d0ccff95b087b7cdd2873f00 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto

Copy link
Copy Markdown
Member Author

@copilot go fix this

GEN      [dotnet] core-macos.dll
  Determining projects to restore...
GEN      apidefinition-tvos.dll
GEN      apidefinition-maccatalyst.dll
GEN      apidefinition-ios.dll
  Restored /Users/builder/azdo/_work/1/s/macios/src/bgen/bgen.csproj (in 301 ms).
GEN      apidefinition-macos.dll
/Users/builder/azdo/_work/1/s/macios/src/accessoryaccess.cs(33,90): error CS1573: Parameter 'error' has no matching param tag in the XML comment for 'AAUsbAccessoryOpenCompletionHandler' (but other parameters do)
make[1]: *** [build/dotnet/macos/apidefinition-macos.dll] Error 1
make[1]: *** Waiting for unfinished jobs....
  bgen -> /Users/builder/azdo/_work/1/s/macios/src/build/dotnet/IDE/bin/common/bgen/bgen.dll
  bgen -> /Users/builder/azdo/_work/1/s/macios/src/build/dotnet/IDE/bin/common/bgen/publish/
  Microsoft.Macios.Generator -> /Users/builder/azdo/_work/1/s/macios/src/build/dotnet/IDE/bin/common/rgen/generator/Microsoft.Macios.Generator.dll
  Microsoft.Macios.Generator -> /Users/builder/azdo/_work/1/s/macios/src/build/dotnet/IDE/bin/common/rgen/generator/publish/
make: *** [all-recurse] Error 1

@vs-mobiletools-engineering-service2

This comment has been minimized.

Co-authored-by: dalexsoto <204671+dalexsoto@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

@copilot go fix this

...

Fixed in 82fdf94 by documenting the nullable error parameter. The exact target now passes locally: make -C src build/dotnet/macos/apidefinition-macos.dll.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [PR Build #8e8538b] Build failed (Build packages) 🔥

Build failed for the job 'Build packages' (with job status 'Failed')

Pipeline on Agent
Hash: 8e8538b7377809fe1a9a88bc2cb947c8bbeaa9ca [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [PR Build #8e8538b] Build failed (Detect API changes) 🔥

Build failed for the job 'Detect API changes' (with job status 'Failed')

Pipeline on Agent
Hash: 8e8538b7377809fe1a9a88bc2cb947c8bbeaa9ca [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

The AAUsbAccessoryOpenCompletionHandler delegate now has XML documentation
comments, so remove its stale entry from the cecil documentation
known-failures baseline. This fixes the Cecil.Tests.Documentation.
VerifyEveryVisibleMemberIsDocumented failure ("1 API marked as a known
failure but now documented").

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 584be516cc47b0b3dc4ffd4e7375e09912a67c41 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #584be51] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 191 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 17 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download
⚠️ Tests on macOS Golden Gate (27): Tests skipped, incorrect beta version. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 584be516cc47b0b3dc4ffd4e7375e09912a67c41 [PR build]

@dalexsoto dalexsoto merged commit 5677708 into xcode27.0 Jul 12, 2026
55 checks passed
@dalexsoto dalexsoto deleted the dev/alex/xc27-accessoryaccess branch July 12, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants